Skip to content

fix(lcx-doctor): use ${TMPDIR:-/tmp} and fix obsolete aggregate hook layout check#84

Closed
JSap0914 wants to merge 1 commit into
code-yeongyu:mainfrom
JSap0914:fix/80-doctor-hardcoded-tmp-and-obsolete-hooks-check
Closed

fix(lcx-doctor): use ${TMPDIR:-/tmp} and fix obsolete aggregate hook layout check#84
JSap0914 wants to merge 1 commit into
code-yeongyu:mainfrom
JSap0914:fix/80-doctor-hardcoded-tmp-and-obsolete-hooks-check

Conversation

@JSap0914

@JSap0914 JSap0914 commented Jun 27, 2026

Copy link
Copy Markdown

Closes #80

Bug

lcx-doctor had two correctness issues (Problems 1 and 3 from #80):

  1. Hardcoded /tmp — the skill instructed the agent to sync sources to /tmp/lazycodex-source and /tmp/openai-codex-source. On systems where /tmp is restricted or TMPDIR points elsewhere this silently breaks source sync.

  2. Obsolete aggregate hook layout check — Step 3 directed the doctor to verify a hooks/hooks.json file under the installed plugin root. The current aggregate OMO plugin manifest (plugin.json) enumerates individual hook file paths directly in its hooks array; hooks/hooks.json is not used (this is explicitly asserted in test/aggregate-manifest.test.mjs). Checking for it produces a false negative against a correct installation.

Fix

  • Replace every hardcoded /tmp path with ${TMPDIR:-/tmp} throughout lcx-doctor/SKILL.md. Introduce a SOURCE_ROOT="${TMPDIR:-/tmp}" variable in the bash sync snippet so it is set once.
  • Replace the hooks/hooks.json payload check with the correct description: individual hook JSON files under hooks/ enumerated directly in plugin.json's hooks array.

Verification

Added two new assertions to the existing lcx-doctor test block in plugins/omo/test/lcx-bug-skills.test.mjs:

assert.match(skill, /$\{TMPDIR:-\/tmp\}/);
assert.doesNotMatch(skill, /\/tmp\/lazycodex-source/);
assert.doesNotMatch(skill, /\/tmp\/openai-codex-source/);
assert.doesNotMatch(skill, /hooks\/hooks\.json/);

RED before: node --test test/lcx-bug-skills.test.mjs → 2 pass / 1 fail
GREEN after: node --test test/lcx-bug-skills.test.mjs → 3 pass / 0 fail

Adjacent tests: node --test test/aggregate-manifest.test.mjs test/aggregate-skills.test.mjs test/aggregate-hooks.test.mjs → 18 pass / 0 fail


Summary by cubic

Fixes two correctness bugs in lcx-doctor: it now honors ${TMPDIR:-/tmp} for source sync and checks the current aggregate hook layout, preventing false negatives and broken runs on systems with restricted /tmp.

  • Bug Fixes
    • Replaced hardcoded /tmp paths with ${TMPDIR:-/tmp}; introduced a SOURCE_ROOT variable in the sync snippet.
    • Updated payload check to expect individual hook JSON files under hooks/ as listed in plugin.json; removed the obsolete hooks/hooks.json check.
    • Extended tests to assert TMPDIR usage and the correct hook layout (no hooks/hooks.json).

Written for commit 0db6024. Summary will update on new commits.

Review in cubic

…n check

The lcx-doctor skill had two correctness bugs reported in issue code-yeongyu#80:

1. Hardcoded /tmp: the skill instructed the agent to sync sources to
   /tmp/lazycodex-source and /tmp/openai-codex-source. On systems where
   /tmp is restricted or TMPDIR points elsewhere this fails. Replace
   every hardcoded /tmp path with ${TMPDIR:-/tmp}, and introduce a
   SOURCE_ROOT variable in the bash sync snippet so callers only set it
   once.

2. Obsolete aggregate hook layout check: step 3 told the doctor to
   verify a hooks/hooks.json file under the installed plugin root. The
   current aggregate OMO plugin manifest (verified by
   test/aggregate-manifest.test.mjs) enumerates individual hook files
   directly in the hooks array — an aggregate hooks.json is not used.
   Replace the check with the current correct shape: individual hook
   JSON files under hooks/ as listed in plugin.json.

RED->GREEN: added two new assertions to the existing lcx-doctor block
in test/lcx-bug-skills.test.mjs. Both failed before this change and
pass after.

Closes code-yeongyu#80
Copilot AI review requested due to automatic review settings June 27, 2026 16:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR! Changes to LazyCodex land through oh-my-openagent — could you open this against omo-codex over there instead? PRs in this repository can't be merged.

This PR was closed because it changes source-code paths in this repository:

plugins/omo/skills/lcx-doctor/SKILL.md
plugins/omo/test/lcx-bug-skills.test.mjs

If you're working with a coding agent, prompt it like this:

I opened #84 ("fix(lcx-doctor): use ${TMPDIR:-/tmp} and fix obsolete aggregate hook layout check") against code-yeongyu/lazycodex, but changes there land through code-yeongyu/oh-my-openagent, where the Codex implementation lives under packages/omo-codex. Read my original PR, then open an equivalent PR against code-yeongyu/oh-my-openagent. In the new PR body, link the original PR (#84), explain that it was first opened against lazycodex, and describe in detail what that PR changed and why.

@github-actions github-actions Bot closed this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lazycodex-ai doctor hardcodes /tmp, relies on inner codex exec networking, and expects obsolete aggregate hook layout

2 participants